<script setup lang="ts">
// import { ref } from 'vue';

const modules = [
  { name: '订单管理', color: '#3498db' },
  { name: '库存管理', color: '#2ecc71' },
  { name: '客户管理', color: '#f39c12' },
  { name: '报表分析', color: '#9b59b6' }
];
</script>

<template>
  <div class="dashboard-container">
    <div class="top-bar">
      <h1 class="welcome-title">欢迎使用ERP系统000000000000000000000000000000000000000000000000</h1>
      <router-link to="/login" class="login-button">登录</router-link>
    </div>
    
    <p class="system-description">企业资源计划管理系统 - 统一管理您的业务流程</p>
    
    <div class="module-grid">
      <div 
        v-for="(module, index) in modules" 
        :key="index"
        class="module-card"
        :style="{ backgroundColor: module.color }"
      >
        <h3>{{ module.name }}</h3>
      </div>
    </div>
  </div>
</template>

<style scoped>
.dashboard-container {
  padding: 2rem;
  margin: 0 auto;
  background-color: #f5f6fa;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 1200px;
}

.welcome-title {
  color: #2c3e50;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.login-button {
  background-color: #3498db;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}

.system-description {
  color: #7f8c8d;
  font-size: 1.2rem;
  margin-bottom: 3rem;
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
}

.module-card {
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  color: white;
  cursor: default;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }
  
  .welcome-title {
    font-size: 2rem;
  }
  
  .system-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .module-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .welcome-title {
    font-size: 1.5rem;
  }
  
  .module-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}
</style>